
texture g_texDiffuse : TEXTUREDIFFUSE;

texture g_effTexture : TEXTUREEFFECT0;

float4 g_noiseOffset : EFFECT0;

sampler2D g_samDiffuse = 
sampler_state
{
	Texture = <g_texDiffuse>;
	MinFilter = Anisotropic;
	MagFilter = Anisotropic;
	MipFilter = Anisotropic;
	MaxAnisotropy = 16.0f;
};

sampler2D g_samEffect = 
sampler_state
{
	Texture = <g_effTexture>;
	MinFilter = Anisotropic;
	MagFilter = Anisotropic;
	MipFilter = Anisotropic;
	MaxAnisotropy = 16.0f;
};


struct VS_OUTPUT
{
	float4 position		: POSITION;
	float2 txt			: TEXCOORD0;
};

struct PS_OUTPUT
{
	float4 color : COLOR0;
};

VS_OUTPUT MyVS(float4	pos		: POSITION,
			   float2   txt		: TEXCOORD0)
{
	VS_OUTPUT output;
	output.position = pos;
	output.txt = txt;
	return output;
}


PS_OUTPUT MyPS(VS_OUTPUT input)
{
	PS_OUTPUT output;

	output.color = tex2D (g_samDiffuse, input.txt) * tex2D(g_samEffect, input.txt + g_noiseOffset.xy);


	return output;
}

technique TestTechnique
{
	pass P0
	{
		VertexShader = compile vs_2_0 MyVS();
		PixelShader  = compile ps_2_0 MyPS();
	}
}